package com.superhero.common.pojo.entity;

import com.fasterxml.jackson.annotation.JsonBackReference;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.util.Date;

@Data
@Accessors(chain = true)
@Entity
@DynamicInsert
@DynamicUpdate
@Table(name = "user_health_info")
public class UserHealthInfo {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    @Column(name = "user_id")
    private Integer userId;

    @Column(name = "community_location")
    private String communityLocation;

    @Column(name = "address")
    private String address;

    @Column(name = "person_type")
    private Integer personType;

    @Column(name = "emergency_contact")
    private String emergencyContact;

    @Column(name = "emergency_contact_phone")
    private String emergencyContactPhone;

    @Column(name = "household_residence")
    private String householdResidence;

    @Column(name = "current_residence")
    private String currentResidence;

    @Column(name = "is_goto_hubei")
    private Integer gotoHubei;

    @Column(name = "is_contact_with_epidemicarea_people")
    private Integer contactWithEpidemicAreaPeople;

    @Column(name = "is_contact_with_patients")
    private Integer contactWithPatients;

    @Column(name = "is_symptoms_within_14day")
    private Integer symptomsWithin14day;

    @Column(name = "is_isolation_observation")
    private Integer isolationObservation;

    @Column(name = "is_normal_temperature")
    private Integer normalTemperature;

    @Column(name = "family_is_symptoms_within_14day")
    private Integer familyIsSymptomsWithin14day;

    @Column(name = "confirmed")
    private Integer confirmed;

    @Column(name = "create_time")
    private Date createTime;

    @Column(name = "update_time")
    private Date updateTime;

    @OneToOne
    @JoinColumn(referencedColumnName = "id", insertable = false, updatable = false)
    @JsonBackReference
    private AuthUser user;

}
